package oop.day09vis.homework;

public class TestWork {
    public static void main(String[] args) {
        // 三个子类 向上造型成动物父类，不能使用eat方法
        Animal eagle = new Eagle();
        Animal frog = new Frog();
        Animal locust= new Locust();
        // 强制类型转换，调用各自的eat方法
       Eagle eagle2 = (Eagle) eagle;
       eagle2.eat();

       Frog frog2 = (Frog) frog;
       frog2.eat();

       Locust locust2 = (Locust) locust;
       locust2.eat();




        MovieTicket ticket1 = new MovieTicket("小明",19);
        MovieTicket ticket2= new MovieTicket("小红",18);
        MovieTicket ticket3=new MovieTicket("吴红",7  );
        MovieTicket ticket4= new MovieTicket();
        ticket4.setName("周刚");
        ticket4.setAge(12);
        ticket4.setPrice(40);


        System.out.println("姓名"+"\t"+"年龄"+"\t"+"票价(元)");
        System.out.println("-------------------");
        ticket1.printInfo();
        ticket2.printInfo();
        ticket3.printInfo();
        ticket4.printInfo();






        // 用户没有提供密码，默认使用123456
        CreditCard cc = new CreditCard(8888);
        System.out.println("cc 用户卡号信息");
        System.out.println("卡号： "+cc.getCardNumber());
        System.out.println("密码： "+cc.getPassword());

        CreditCard cc2 = new CreditCard(6666666,99999);
        System.out.println("cc2用户卡号信息");
        System.out.println("卡号： "+cc2.getCardNumber());
        System.out.println("密码： "+cc2.getPassword());
    }
}
